import * as THREE from "three";
function circle(r) {
    var arc = new THREE.ArcCurve(0, 0, r, 0, 2 * Math.PI, true);
    // 获取点数越多，圆弧越光滑
    var points = arc.getPoints(100); //返回一个vector2对象作为元素组成的数组
    var geometry = new THREE.BufferGeometry();
    //setFromPoints方法的本质：遍历points把vector2转变化vector3
    geometry.setFromPoints(points);
    var material = new THREE.LineBasicMaterial({
        color: 0x0f4984,
        linewidth: 1
    });
    // THREE.Line
    var line = new THREE.LineLoop(geometry, material); //起始点闭合
    // 圆弧线默认在XOY平面上，绕x轴旋转到XOZ平面上
    line.rotateX(Math.PI / 2);
    return line
}
export default circle
